import request from '@/utils/request'
import { getToken } from '@/utils/auth'
  

  export function apply(params) {
	return request({
	  url: 'api/assetsort/assetCertificate',
	  method: 'get',
	  params
	})
  }

  export function applyAddList(params) {
	return request({
	  url: 'api/assetsort/assetCertificate/queryDebits',
	  method: 'get',
	  params
	})
  }


  export function adjustDetails(id) {
	return request({
	  url: 'api/assetsort/assetCertificate/adjust/' + id,
	  method: 'get'
	})
  }
  
  export function saveDate(data) {
	return request({
	  url: 'api/assetsort/assetCertificates/batch',
	  method: 'post',
	  data
	})
  }

 
  export function modelAnalysis(params) {
	return request({
	  url: 'api/assetsort/assetCertificate/modelAnalysis',
	  method: 'post',
	  params
	})
  }

  export function particular(id) {
	return request({
	  url: 'api/assetsort/assetCertificate/' + id,
	  method: 'get'
	})
  }


  export function pattern(params) {
	return request({
	  url: 'api/assetsort/assetModel',
	  method: 'get',
	  params
	})
  }



//   export function modelAdd(params) {
// 	return request({
// 	  url: 'api/assetsort/assetModel',
// 	  method: 'post',
// 	  params
// 	})
//   }

  export function modelAdd(data) {
	return request({
	  url: 'api/assetsort/assetModel',
	  method: 'post',
	  data
	})
  }


  export function rule(id) {
	return request({
	  url: 'api/assetsort/assetModel/' + id,
	  method: 'get'
	})
  }

  export function listBySorttype(params) {
	return request({
	  url: '/api/assetsort/assetModel/rule',
	  method: 'get',
	  params
	})
  }

  
 export function ruleDetailsEdit(data) {
	return request({
	  url: 'api/assetsort/assetModel/rule',
	  method: 'put',
	  data
	})
  }

  export function ruleEdit(data) {
	return request({
	  url: 'api/assetsort/assetModel',
	  method: 'put',
	  data
	})
  }

  
  export function approval(params) {
	return request({
	  url: 'api/assetsort/approval',
	  method: 'get',
	  params
	})
  }



export function taskForm(id) {
	return request({
	  url: 'task/workflow-taskForm/task-forms/' + id,
	  method: 'get'
	})
}


export function approvalForm(id,claimUserId,data) {
	return request({
	  url: 'task/workflow-taskForm/task-forms/completeAndClaimTask/' + id + '?claimUserId='+claimUserId,
	  method: 'post',
	  data
	})
}

export function approvalEndForm(id,data) {
	return request({
	  url: 'task/workflow-taskForm/task-forms/completeAndClaimTask/' + id ,
	  method: 'post',
	  data
	})
}


export function platform(params) {
	return request({
	  url: 'api/assetsort/monitorWorkbench',
	  method: 'get',
	  params
	})
  }



  export function platDetailsList(id) {
	return request({
	  url: 'task/workflow-task/rest/query/' + id +"/tasks",
	  method: 'get'
	})
}



export function approvalLoan(params) {
	return request({
	  url: 'api/loanManage/approval',
	  method: 'get',
	  params
	})
  }


//   export function getProcessDefinitionId(params) {
// 	return request({
// 	  url: 'api/processBusiConfig/processInfo',
// 	  method: 'get',
// 	  params
// 	})
//   }

//   export function getProcessDefinitionId(id) {
// 	return request({
// 	  url: 'api/processBusiConfig/processInfo?busiFlag=' + id,
// 	  method: 'get'
// 	})
//   }


  export function getProcessDefinitionId(id) {
	return request({
	  url: 'api/processBusiConfig/processInfo?busiFlag=' + id ,
	  method: 'get'
	})
}
export function processTreeList(id) { 
    return request({
		url: 'task/workflow-task/query/candidateGroup?processDefinitionId=' + id,
		method: 'post',
	})
}	
//   config.headers['Authorization'] = 'Bearer ' + getToken()
//   export function processTreeList() {  
// 	return request({
// 	 url: 'task/workflow-task/query/candidateGroup?processDefinitionId=test_asset_class_process:5:dfb2b87e-257e-11ea-a6f0-c0a5dda0ba60',
// 	  method: 'post',
// 	})
// }


export function processLoanTreeList() {  
	return request({
	 // url: 'task/workflow-task/query/candidateGroup/firstTask?processDefinitionId=report_check_process:2:06677af6-17d1-11ea-8c68-c0a5dda0ba60',
	 // url: 'task/workflow-task/query/candidateGroup/firstTask?processDefinitionId=test_asset_class_process:1:db4d4857-255e-11ea-a6f0-c0a5dda0ba60',
	 url: 'task/workflow-task/query/candidateGroup?processDefinitionId=test_loan_after_process:1:5c69e2ec-2788-11ea-b64b-c0a5dda0ba60',
	  method: 'post',
	//   headers:{
	// 	Authorization:'Bearer ' + getToken()
	//   }
	})
}



// export function taskForm() {
// 	return request({
// 	  url: 'task/workflow-taskForm/task-forms/667f0b4d-20b6-11ea-ae14-7c67a2a20dcd',
// 	  method: 'get',
// 	//   headers:{
// 	// 	Authorization:'Bearer ' + getToken()
// 	//   }
// 	})
// }

